﻿using Microsoft.AspNetCore.Idenmpotency;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Idenmpotency
{
    /// <summary>
    /// 接口：幂等性请求仓储
    /// </summary>
    public interface IIdenmpotencyRequestRepositroy
    {
        /// <summary>
        /// 请求记录是否存在
        /// </summary>
        /// <typeparam name="TRequestId"></typeparam>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<bool> IsExistAscyn(IIdenmpotencyRequest request);

        /// <summary>
        /// 保存请求记录
        /// </summary>
        /// <typeparam name="TRequestId"></typeparam>
        /// <param name="request"></param>
        /// <returns></returns>
        public Task SaveAsync(IIdenmpotencyRequest request);

    }
}
